<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Jekyll v3.8.5">
    <title>Signin Template · Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" th:href="@{/bootstrap/bootstrap.min.css}" crossorigin="anonymous">
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>


</head>
<body class="text-center">
<form class="form-signin" id="loginFrom">
    <h1 class="h3 mb-3 font-weight-normal">用户登录</h1>

    <label class="sr-only">Username</label>
    <input type="text" name="username" id="username" class="form-control" required autofocus>
    <label for="password" class="sr-only">Password</label>
    <input type="password" name="password" id="password" class="form-control" required>
    <div class="checkbox mb-3">
        <label>
            <input type="checkbox" value="remember-me"> 记住我
        </label>
    </div>
    <button class="btn btn-lg btn-primary btn-block" onclick="login()">登录</button>
</form>
</body>
<script>
    function login(){
        console.log("toLogin")
        $.ajax({
            url:"/doLogin",
            type:"POST",
            data:{
                username:$("#username").val(),
                password:$("#password").val()
            },
            success:function (data){
                console.log(data)
                window.location.href="/goods/toList"
            }
        })
    }
</script>
</html>
